﻿@model string
@{
	var prifix = Model;
	var codespace = ViewContext.RouteData.DataTokens["area"].ToString();
	var entityTypeCode = ViewContext.RouteData.Values["Controller"].ToString();
	string enabled = this.CurrentUser().IsDeveloper() ? "" : "readonly='readonly'";
}
<form id="@(prifix)form1" method="post">
	<input name="Id" class="mini-hidden" />
	<div style="padding-left: 11px;">
		<table>
			<tr>
				<td>
					@Html.IconLabel("Code")
				</td>
				<td>
					<input name="Code" class="mini-textbox" @enabled required="true" />
					@Html.Qtip("Code", entityTypeCode, codespace)
				</td>
				<td>
					@Html.IconLabel("Name")
				</td>
				<td>
					<input name="Name" class="mini-textbox" required="true" />
					@Html.Qtip("Name", entityTypeCode, codespace)
				</td>
			</tr>
			<tr>
				<td>
					@Html.IconLabel("ParentCode")
				</td>
				<td>
					<input name="ParentCode" class="mini-textbox" @enabled required="false" />
					@Html.Qtip("ParentCode", entityTypeCode, codespace)
				</td>
				<td>
					@Html.IconLabel("ShortName")
				</td>
				<td>
					<input name="ShortName" class="mini-textbox" />
					@Html.Qtip("ShortName", entityTypeCode, codespace)
				</td>
			</tr>
			<tr>
				<td>
					@Html.IconLabel("InnerPhone")
				</td>
				<td>
					<input name="InnerPhone" class="mini-textbox" />
					@Html.Qtip("InnerPhone", entityTypeCode, codespace)
				</td>
				<td>
					@Html.IconLabel("OuterPhone")
				</td>
				<td>
					<input name="OuterPhone" class="mini-textbox" />
					@Html.Qtip("OuterPhone", entityTypeCode, codespace)
				</td>
			</tr>
			<tr>
				<td>
					@Html.IconLabel("CategoryCode")
				</td>
				<td colspan="3">
					<input name="CategoryCode" class="mini-combobox" style="width: 350px;" required="true"
						   textfield="name" valuefield="code" data="@Html.DicItemJsonArray(Html.GetProperty("CategoryCode"))" shownullitem="false" />
					@Html.Qtip("CategoryCode", entityTypeCode, codespace)
				</td>
			</tr>
			<tr>
				<td>
					@Html.IconLabel("IsEnabled")
				</td>
				<td>
					<input name="IsEnabled" class="mini-combobox" @enabled style="width: 125px;" required="true"
						textfield="name" valuefield="code" data="@Html.DicItemJsonArray(Html.GetProperty("IsEnabled"))" shownullitem="false" />
					@Html.Qtip("IsEnabled", entityTypeCode, codespace)
				</td>
				<td>
					@Html.IconLabel("SortCode")
				</td>
				<td>
					<input name="SortCode" class="mini-textbox" vtype="int" value="0" required="true" />
					@Html.Qtip("SortCode", entityTypeCode, codespace)
				</td>
			</tr>
			<tr>
				<td>
					@Html.IconLabel("Address")
				</td>
				<td colspan="3">
					<input name="Address" class="mini-textarea" style="width: 380px;" />
					@Html.Qtip("Address", entityTypeCode, codespace)
				</td>
			</tr>
			<tr>
				<td>
					@Html.IconLabel("Description")
				</td>
				<td colspan="3">
					<input name="Description" class="mini-textarea" style="width: 380px;" />
					@Html.Qtip("Description", entityTypeCode, codespace)
				</td>
			</tr>
		</table>
	</div>
</form>
